3.6 \(\int \cot ^3(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=68 \[ -\frac {a (B+i A) \cot (c+d x)}{d}-\frac {a (A-i B) \log (\sin (c+d x))}{d}-a x (B+i A)-\frac {a A \cot ^2(c+d x)}{2 d} \]

[Out]

-a*(I*A+B)*x-a*(I*A+B)*cot(d*x+c)/d-1/2*a*A*cot(d*x+c)^2/d-a*(A-I*B)*ln(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3591, 3529, 3531, 3475} \[ -\frac {a (B+i A) \cot (c+d x)}{d}-\frac {a (A-i B) \log (\sin (c+d x))}{d}-a x (B+i A)-\frac {a A \cot ^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^3*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

-(a*(I*A + B)*x) - (a*(I*A + B)*Cot[c + d*x])/d - (a*A*Cot[c + d*x]^2)/(2*d) - (a*(A - I*B)*Log[Sin[c + d*x]])
/d

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3529

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e +
f*x])^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c
 - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3591

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e
_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((b*c - a*d)*(A*b - a*B)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2
 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e + f*x])^(m + 1)*Simp[a*A*c + b*B*c + A*b*d - a*B*d - (A*b*
c - a*B*c - a*A*d - b*B*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0]
 && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \cot ^3(c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=-\frac {a A \cot ^2(c+d x)}{2 d}+\int \cot ^2(c+d x) (a (i A+B)-a (A-i B) \tan (c+d x)) \, dx\\ &=-\frac {a (i A+B) \cot (c+d x)}{d}-\frac {a A \cot ^2(c+d x)}{2 d}+\int \cot (c+d x) (-a (A-i B)-a (i A+B) \tan (c+d x)) \, dx\\ &=-a (i A+B) x-\frac {a (i A+B) \cot (c+d x)}{d}-\frac {a A \cot ^2(c+d x)}{2 d}-(a (A-i B)) \int \cot (c+d x) \, dx\\ &=-a (i A+B) x-\frac {a (i A+B) \cot (c+d x)}{d}-\frac {a A \cot ^2(c+d x)}{2 d}-\frac {a (A-i B) \log (\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.37, size = 76, normalized size = 1.12 \[ -\frac {a \left (2 (B+i A) \cot (c+d x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};-\tan ^2(c+d x)\right )+2 (A-i B) (\log (\tan (c+d x))+\log (\cos (c+d x)))+A \cot ^2(c+d x)\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^3*(a + I*a*Tan[c + d*x])*(A + B*Tan[c + d*x]),x]

[Out]

-1/2*(a*(A*Cot[c + d*x]^2 + 2*(I*A + B)*Cot[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[c + d*x]^2] + 2*(A -
 I*B)*(Log[Cos[c + d*x]] + Log[Tan[c + d*x]])))/d

________________________________________________________________________________________

fricas [A]  time = 0.47, size = 111, normalized size = 1.63 \[ \frac {2 \, {\left (2 \, A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \, {\left (A - i \, B\right )} a - {\left ({\left (A - i \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, {\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (A - i \, B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )}{d e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

(2*(2*A - I*B)*a*e^(2*I*d*x + 2*I*c) - 2*(A - I*B)*a - ((A - I*B)*a*e^(4*I*d*x + 4*I*c) - 2*(A - I*B)*a*e^(2*I
*d*x + 2*I*c) + (A - I*B)*a)*log(e^(2*I*d*x + 2*I*c) - 1))/(d*e^(4*I*d*x + 4*I*c) - 2*d*e^(2*I*d*x + 2*I*c) +
d)

________________________________________________________________________________________

giac [B]  time = 0.79, size = 162, normalized size = 2.38 \[ -\frac {A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 16 \, {\left (A a - i \, B a\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) + 8 \, {\left (A a - i \, B a\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - \frac {12 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 i \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 i \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - A a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/8*(A*a*tan(1/2*d*x + 1/2*c)^2 - 4*I*A*a*tan(1/2*d*x + 1/2*c) - 4*B*a*tan(1/2*d*x + 1/2*c) - 16*(A*a - I*B*a
)*log(tan(1/2*d*x + 1/2*c) + I) + 8*(A*a - I*B*a)*log(tan(1/2*d*x + 1/2*c)) - (12*A*a*tan(1/2*d*x + 1/2*c)^2 -
 12*I*B*a*tan(1/2*d*x + 1/2*c)^2 - 4*I*A*a*tan(1/2*d*x + 1/2*c) - 4*B*a*tan(1/2*d*x + 1/2*c) - A*a)/tan(1/2*d*
x + 1/2*c)^2)/d

________________________________________________________________________________________

maple [A]  time = 0.45, size = 101, normalized size = 1.49 \[ -i A a x -\frac {i A \cot \left (d x +c \right ) a}{d}-\frac {i A a c}{d}+\frac {i B a \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {a A \left (\cot ^{2}\left (d x +c \right )\right )}{2 d}-\frac {a A \ln \left (\sin \left (d x +c \right )\right )}{d}-a B x -\frac {B \cot \left (d x +c \right ) a}{d}-\frac {B a c}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^3*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

-I*A*a*x-I/d*A*cot(d*x+c)*a-I/d*A*a*c+I/d*B*a*ln(sin(d*x+c))-1/2*a*A*cot(d*x+c)^2/d-a*A*ln(sin(d*x+c))/d-a*B*x
-1/d*B*cot(d*x+c)*a-1/d*B*a*c

________________________________________________________________________________________

maxima [A]  time = 0.66, size = 83, normalized size = 1.22 \[ \frac {2 \, {\left (d x + c\right )} {\left (-i \, A - B\right )} a + {\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 2 \, {\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )\right ) - \frac {{\left (2 i \, A + 2 \, B\right )} a \tan \left (d x + c\right ) + A a}{\tan \left (d x + c\right )^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*(-I*A - B)*a + (A - I*B)*a*log(tan(d*x + c)^2 + 1) - 2*(A - I*B)*a*log(tan(d*x + c)) - ((2*I*
A + 2*B)*a*tan(d*x + c) + A*a)/tan(d*x + c)^2)/d

________________________________________________________________________________________

mupad [B]  time = 6.21, size = 60, normalized size = 0.88 \[ -\frac {\frac {A\,a}{2}+\mathrm {tan}\left (c+d\,x\right )\,\left (B\,a+A\,a\,1{}\mathrm {i}\right )}{d\,{\mathrm {tan}\left (c+d\,x\right )}^2}-\frac {a\,\mathrm {atan}\left (2\,\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A-B\,1{}\mathrm {i}\right )\,2{}\mathrm {i}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^3*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i),x)

[Out]

- ((A*a)/2 + tan(c + d*x)*(A*a*1i + B*a))/(d*tan(c + d*x)^2) - (a*atan(2*tan(c + d*x) + 1i)*(A - B*1i)*2i)/d

________________________________________________________________________________________

sympy [B]  time = 0.80, size = 114, normalized size = 1.68 \[ - \frac {a \left (A - i B\right ) \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{d} + \frac {- 2 i A a - 2 B a + \left (4 i A a e^{2 i c} + 2 B a e^{2 i c}\right ) e^{2 i d x}}{i d e^{4 i c} e^{4 i d x} - 2 i d e^{2 i c} e^{2 i d x} + i d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**3*(a+I*a*tan(d*x+c))*(A+B*tan(d*x+c)),x)

[Out]

-a*(A - I*B)*log(exp(2*I*d*x) - exp(-2*I*c))/d + (-2*I*A*a - 2*B*a + (4*I*A*a*exp(2*I*c) + 2*B*a*exp(2*I*c))*e
xp(2*I*d*x))/(I*d*exp(4*I*c)*exp(4*I*d*x) - 2*I*d*exp(2*I*c)*exp(2*I*d*x) + I*d)

________________________________________________________________________________________